"""
类型转换
"""

# 将数据转换成整型，浮点型，字符串
a = int("111")
b = float(123)
c = str(123)
print(a,type(a))
print(b,type(b))
print(c,type(c))

# 错误示范：字符串转数字的时候字符串里面必须是数字
# ValueError: invalid literal for int() with base 10: '你好'
# num = int("你好")
# print(num,type(num))

# 浮点数转整数会丢失精度
int_num = int(12.13)
print(int_num,type(int_num))